package top.greatxiaozou.utils;

import top.greatxiaozou.dto.DtoTopic;
import top.greatxiaozou.pojo.Topic;

import java.util.Date;

public class TopicUtils {
    public static Topic getTopic(DtoTopic dtoTopic,String username){
        Topic topic = new Topic();

        topic.setDate(new Date());
        topic.setAcontent(dtoTopic.getAcontent());
        topic.setSort(dtoTopic.getSort());
        topic.setUsername(username);
        topic.setTitle(dtoTopic.getTitle());
        //默认点赞数为0
        topic.setPraise(0);



        return topic;
    }
}
